import 'package:flutter/material.dart';

class MyCardTheme {
  static Color? color = Colors.white;
  static LinearGradient? gradient;
  static BorderRadius borderRadius = BorderRadius.circular(12);
  static EdgeInsets? margin;
  static EdgeInsets? padding;
  static double? height;
  static double? width;
  static AlignmentGeometry? alignment;
  static List<BoxShadow>? boxShadow;
}

class MyCard extends StatelessWidget {
  final Color? color;
  final LinearGradient? gradient;
  final BorderRadius? borderRadius;
  final Widget child;
  final EdgeInsets? margin;
  final EdgeInsets? padding;
  final double? height;
  final double? width;
  final AlignmentGeometry? alignment;
  final List<BoxShadow>? boxShadow;
  const MyCard(
      {Key? key,
      this.color,
      this.gradient,
      this.borderRadius,
      required this.child,
      this.margin,
      this.padding,
      this.height,
      this.width,
      this.alignment,
      this.boxShadow})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      alignment: alignment,
      width: width,
      height: height,
      margin: margin,
      decoration: BoxDecoration(
        borderRadius: borderRadius ?? MyCardTheme.borderRadius,
        //color: color ?? Colors.white,
        //gradient: gradient,
        boxShadow: boxShadow ?? MyCardTheme.boxShadow,
      ),
      child: ClipRRect(
        borderRadius: borderRadius ?? MyCardTheme.borderRadius,
        child: Container(
          padding: padding,
          decoration: BoxDecoration(
            //borderRadius: borderRadius ?? BorderRadius.circular(12),
            color: color ?? MyCardTheme.color,
            gradient: gradient ?? MyCardTheme.gradient,
            //boxShadow: myCardBoxShadow ?? boxShadow,
          ),
          child: child,
        ),
      ),
    );
  }
}
